package com.sample.thread.wait;

/**
 * @comments
 * @author zg
 * @date 2021年3月9日
 */
public class PhoneNotifier implements Runnable {

    private Phone phone;

    public PhoneNotifier(Phone phone) {
        this.phone = phone;
    }

    @Override
    public void run() {
        synchronized (phone) {
            System.out.println("提醒：通话时间到了。");
            phone.notify();
            // msg.notifyAll();
        }
    }

}
